package org.JQbitorrentClinet.request.log;

import com.google.gson.reflect.TypeToken;
import lombok.Builder;
import org.JQbitorrentClinet.base.BaseGetParam;
import org.JQbitorrentClinet.pojo.log.LogRecord;

import java.util.List;

@Builder
public class GetLogParam extends BaseGetParam {

    Boolean normal;
    Boolean info;
    Boolean warning;
    Boolean critical;
    Integer last_known_id;

    public GetLogParam(Boolean normal, Boolean info, Boolean warning, Boolean critical, Integer last_known_id){
        this.normal = normal;
        this.info = info;
        this.warning = warning;
        this.critical = critical;
        this.last_known_id = last_known_id;
        responseType = new TypeToken<List<LogRecord>>(){}.getType();
    }

    @Override
    public String getApiUrl() {
        return "/api/v2/log/main";
    }
}
